<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>v-if和v-show</title>
        <script src="js/vuejs-2.5.16.js"></script>
    </head>
    <body>
        <div id="app">
            <span v-if="flag">船只</span>
            <span v-show="flag">itcast</span>
            <button @click="toggle">切换</button>
        </div>
    </body>
    <script>
        //view model
        new Vue({
            el:"#app",
            data:{
                flag:false

            },
            methods:{
                toggle:function (){
                    this.flag = !this.flag;
                }
            }
        });
        
    </script>
</html>